API Documentation
Public Member Functions | List of all members
nkWinUi::RelativeLayout Class Referencefinal

Implements a layout positioning its children components relative to each other. More...

Inheritance diagram for nkWinUi::RelativeLayout:
nkWinUi::Layout nkExport::Exportable

Public Member Functions

 RelativeLayout ()
 
 ~RelativeLayout ()
 
Component * getComponentAt (unsigned int index)
 
virtual void setParentComponent (Component *parent) override
 
void addComponent (Component *component, const nkMaths::Rectangle &area)
 
void addComponent (Component *component, const nkMaths::Rectangle &area, RELATIVE_POSITION position, Component *relativeTo)
 
virtual void removeComponent (Component *component) override
 
virtual void update () override
 
virtual void exportComponentsNodeEntry (nkExport::Node *rootNode) override
 
virtual void processComponentsNodeEntry (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkWinUi::Layout
 Layout ()
 
virtual ~Layout ()
 
Component * getParentComponent () const
 
LAYOUT_TYPE getType () const
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable ()
 
virtual ~Exportable ()
 

Detailed Description

Implements a layout positioning its children components relative to each other.

Constructor & Destructor Documentation

◆ RelativeLayout()

nkWinUi::RelativeLayout::RelativeLayout ( )

Constructor.

◆ ~RelativeLayout()

nkWinUi::RelativeLayout::~RelativeLayout ( )

Destructor.

Member Function Documentation

◆ getComponentAt()

Component* nkWinUi::RelativeLayout::getComponentAt ( unsigned int  index)
Parameters
indexThe wanted component's index.
Returns
The child component at given index, if available. If out of bounds, nullptr.

◆ setParentComponent()

virtual void nkWinUi::RelativeLayout::setParentComponent ( Component *  parent)
overridevirtual

◆ addComponent() [1/2]

void nkWinUi::RelativeLayout::addComponent ( Component *  component,
const nkMaths::Rectangle &  area 
)

Adds a child component to be placed by this layout.

Parameters
componentThe component to place.
areaThe area this component will have in the layout.
Remarks
Can be called for components that should act as anchor in the layout.

◆ addComponent() [2/2]

void nkWinUi::RelativeLayout::addComponent ( Component *  component,
const nkMaths::Rectangle &  area,
RELATIVE_POSITION  position,
Component *  relativeTo 
)

Adds a child component to be place by this layout.

Parameters
componentThe component to place.
areaThe area this component will have in the layout, relative to the relativeTo component.
positionThe position the component should have, compared to the relativeTo component.
relativeToThe component being the anchor to place the new child component to add. It should be part of this layout, already.

◆ removeComponent()

virtual void nkWinUi::RelativeLayout::removeComponent ( Component *  component)
overridevirtual

◆ update()

virtual void nkWinUi::RelativeLayout::update ( )
overridevirtual

◆ exportComponentsNodeEntry()

virtual void nkWinUi::RelativeLayout::exportComponentsNodeEntry ( nkExport::Node *  rootNode)
overridevirtual

◆ processComponentsNodeEntry()

virtual void nkWinUi::RelativeLayout::processComponentsNodeEntry ( nkExport::Node *  rootNode)
overridevirtual

The documentation for this class was generated from the following file: